package com.netty.quartz.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.netty.common.annotation.DataSource;
import com.netty.common.enums.DataSourceType;
import com.netty.quartz.entity.SysJobLog;
import com.netty.quartz.mapper.SysJobLogMapper;
import com.netty.quartz.service.ISysJobLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author LiuXiaoYu
 * @date 2021/10/16- 10:52
 */
@Service
@DataSource(DataSourceType.SLAVE)
@Slf4j
public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog> implements ISysJobLogService {

    @Autowired
    private SysJobLogMapper sysJobLogMapper;
    /**
     * 异步写日志
     * @param sysJobLog 日志
     */
    @Override
    public void addJobLog(SysJobLog sysJobLog) {
        sysJobLogMapper.insert(sysJobLog);
    }
}
